import { BrowserWindow, ipcMain } from 'electron';
import { helloService } from '../../service/hello/hello.service';

export class helloController {

    win: BrowserWindow = null;
    helloService: helloService = null;

    constructor(win: BrowserWindow) {
        this.win = win;
        this.helloService = new helloService(win);
    }

    getData(data) {
        let callbackData = this.helloService.getData();
        let callbackObj = { code: 200, to: 'login.component', data: callbackData, msg: '' }
        this.win.webContents.send('electronMaintoRender', callbackObj);
    }

    ajaxData(event, data) {
        return this.helloService.ajaxData(data);
    }
}